package com.f2prateek.rx.preferences2;

import io.reactivex.annotations.NonNull;
import ohos.data.preferences.Preferences;

final class FloatAdapter implements RealPreference.Adapter<Float> {
  static final FloatAdapter INSTANCE = new FloatAdapter();

  @NonNull
  @Override public Float get(@NonNull String key, @NonNull Preferences preferences,
                             @NonNull Float defaultValue) {
    return preferences.getFloat(key, defaultValue);
  }

  @Override public void set(@NonNull String key, @NonNull Float value,
      @NonNull Preferences editor) {
    editor.putFloat(key, value);
  }
}
